package com.skirmisher.video.aliVideo.group;

import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.exceptions.ServerException;
import com.aliyuncs.profile.DefaultProfile;
import com.aliyuncs.vs.model.v20181212.DescribeGroupRequest;
import com.aliyuncs.vs.model.v20181212.DescribeGroupResponse;
import com.aliyuncs.vs.model.v20181212.DescribeGroupsRequest;
import com.aliyuncs.vs.model.v20181212.DescribeGroupsResponse;
import com.skirmisher.video.aliVideo.BaseAliVideo;
import com.skirmisher.video.entity.frame.AliPropertiesEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName AliGroup
 * @Description TODO 阿里云空间相关apl连接类
 * @Author hanwangxin
 * @Date 2020/11/7 4:18 下午
 * @Version 1.0
 */
@Service
public class AliGroup extends BaseAliVideo {

    /**
     * @Author hanwangxin
     * @Description //TODO 阿里云空间列表查询 * @Date 4:25 下午 2020/11/7
     * @Param []
     * @return void
     **/
    public List<DescribeGroupsResponse.Group> describeGroups() throws ClientException {
        

        IAcsClient client = getClient();

        DescribeGroupsRequest request = new DescribeGroupsRequest();

        // 发起请求并处理应答或异常
        DescribeGroupsResponse response;
        response = client.getAcsResponse(request);
        return response.getGroups();
        
    }

    /**
     * @Author hanwangxin
     * @Description //TODO 获取空闲详情 * @Date 5:51 下午 2020/11/7
     * @Param [groupId]
     * @return com.aliyuncs.vs.model.v20181212.DescribeGroupResponse
     **/
    public DescribeGroupResponse describeGroup(String groupId) throws ClientException {

        IAcsClient client = getClient();
        DescribeGroupRequest request = new DescribeGroupRequest();
        DescribeGroupResponse acsResponse = client.getAcsResponse(request);
        return  acsResponse;
        
    }



}
